import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/icon',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/Icon.vue'),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/project',
                    component: () => import(/* webpackChunkName: "project" */ '../components/page/ProjectList.vue'),
                    meta: { title: '项目管理' }
                },
                {
                    path: '/module',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/ModuleList.vue'),
                    meta: { title: '模块管理' }
                },
                {
                    path: '/api',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/ApiList.vue'),
                    meta: { title: '接口管理' }
                },
                {
                    path: '/apiadd',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/ApiAdd.vue'),
                    meta: { title: '接口新增' }
                },
                {
                    path: '/testcase',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/TestCase.vue'),
                    meta: { title: '用例管理' }
                },
                {
                    path: '/env',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/EnvList.vue'),
                    meta: { title: '运行环境' }
                },
                {
                    path: '/report',
                    component: () => import(/* webpackChunkName: "module" */ '../components/page/ReportsList.vue'),
                    meta: { title: '运行报告' }
                },
                {
                    // vue-schart组件
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "chart" */ '../components/page/BaseCharts.vue'),
                    meta: { title: 'schart图表' }
                },
                {
                    // 拖拽列表组件
                    path: '/drag',
                    component: () => import(/* webpackChunkName: "drag" */ '../components/page/DragList.vue'),
                    meta: { title: '拖拽列表' }
                },
                {
                    // 拖拽Dialog组件
                    path: '/dialog',
                    component: () => import(/* webpackChunkName: "dragdialog" */ '../components/page/DragDialog.vue'),
                    meta: { title: '拖拽弹框' }
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
